package com.xiaoge;

import com.xiaoge.environment.TestEnvironment;
import com.xiaoge.resource.TestResource;
import com.xiaoge.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * TODO
 *
 * @author <a href="mailto:1330137071@qq.com">Zhang Xiao</a>
 * @since
 */
public class ZhangXiaoUtilApplication {
	public static void main(String[] args) throws Exception {
		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
		UserService userService = (UserService)applicationContext.getBean("userService");
		userService.test();

		TestResource testResource = (TestResource) applicationContext.getBean("testResource");
		testResource.test();

		TestEnvironment testEnvironment = (TestEnvironment) applicationContext.getBean("testEnvironment");
		testEnvironment.test();

		// todo 发布事件
//		applicationContext.publishEvent("1111");
	}
}